<template>
  <!--<div>我是第二个子组件 -&#45;&#45; {{val}}</div>-->
  <div>我是第二个子组件2222222</div>
</template>

<script>
/* eslint-disable import/newline-after-import */

import { bus } from '../bus';
export default {
  name: 'zizujian2',
  props: ['val'],
  //  接收父组件的自定义属性名，达到父组件给子组件传值的目的
  data() {
    return {
      msg: '我是第二个子组件2222222222',
      arr: [],
    };
  },
  created() {
    bus.$on('a1', (data) => {
      this.msg = data;
    });
  },
};
</script>

<style scoped>
  div{
    height: 100px;
    background: coral;
  }
</style>
